Skip to content

Conversation

@josesimoes
Copy link
Member

Description

  • Add parameter to WebServer constructor and rework constructors accordingly.
  • Update README to add note for this new parameter.

Motivation and Context

  • When calling HttpListener with a null IPAddress parameter the code grabs the IP from the default interface. When serving pages from a soft AP, the IP address is different. Therefore, it's necessary to allow the caller to specify an IP address to bind the server to.

How Has This Been Tested?

  • Local app testing HTTP access to server behind an ESP32 soft AP.

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

- Add parameter to WebServer constructor and rework constructors accordingly.
- Update README to add note for this new parameter.
@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • README.md is excluded by !**/*.md and included by none
  • nanoFramework.WebServer/WebServer.cs is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@josesimoes josesimoes requested a review from Copilot October 14, 2025 00:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for specifying an IP address when creating a WebServer instance, which is necessary for scenarios where the server needs to bind to a specific interface (e.g., when serving from an ESP32 soft access point). The changes introduce a new constructor parameter while maintaining backward compatibility through constructor chaining.

Key Changes

  • Added a new constructor parameter for IP address binding in the WebServer class
  • Updated existing constructors to chain to the new comprehensive constructor
  • Updated README documentation to mention the new optional IP address parameter

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
nanoFramework.WebServer/WebServer.cs Added IP address parameter to constructors and updated HttpListener instantiation
README.md Added documentation note about optional IP address parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqubecloud
Copy link

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@josesimoes josesimoes merged commit 863b167 into nanoframework:main Oct 14, 2025
6 checks passed
@josesimoes josesimoes deleted the add-constructor branch October 14, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants